package de.koller.worlders.engine.entity.zone.topdown;

import de.koller.worlders.engine.entity.zone.Zone;
import de.koller.worlders.engine.entity.zone.ZoneEffect;
import de.koller.worlders.engine.tiles.ITile;
import de.koller.worlders.engine.tiles.data.ITileCreator;
import de.koller.worlders.render.VisualMap;
import de.koller.worlders.render.visual.DisplayRenderObject;

public class BasicFloor extends ZoneEffect {
	public static final int GEN_ID = 15;
	
	public static final ITileCreator GEN_INSTANCE = new ITileCreator() {
		@Override public ITile newInstance() {
			return new Zone().addEffect( new BasicFloor( BasicFloor.ZoneType.Grass ) );
		}
		
		@Override public DisplayRenderObject getIcon() { return VisualMap.floorGrass; }
		@Override public String getName() { return "Top Down: Gras"; }
	};
	
	public static final ITileCreator GEN_INSTANCE_1 = new ITileCreator() {
		@Override public ITile newInstance() {
			return new Zone().addEffect( new BasicFloor( BasicFloor.ZoneType.Sand ) );
		}
		
		@Override public DisplayRenderObject getIcon() { return VisualMap.floorSand; }
		@Override public String getName() { return "Top Down: Sand"; }
	};
	
	private final BasicFloor.ZoneType disp;

	public BasicFloor( BasicFloor.ZoneType disp ) {
		this.disp = disp;
	}
	
	@Override
	public void init( Zone z ) {
		super.init( z );

		if( disp == BasicFloor.ZoneType.Grass )		z.getTile().setVisual( VisualMap.floorGrass );
		if( disp == BasicFloor.ZoneType.Sand )		z.getTile().setVisual( VisualMap.floorSand );
	
		if( z.root == null )
			return;
		
	}	
	
	private static enum ZoneType {
		Sand, Grass;
	}
	
}
